package com.foreknow.demo03;

/**
 * 无返回值的方法与有返回的方法的区别
 *
 */
public class MethodDemo3 {

  public static void add(int a,int b) {
    int c = a+b;
    System.out.println(c);
  }

  public static int sum(int a,int b,int c){
    int s= a+b+c;
    return s;
  }

  public static void main(String[] args) {
      MethodDemo3.add(1,2);

      int s = MethodDemo3.sum(1,2,3);
      if(s==6){
        System.out.println("调用有返回值的方法");
      }
  }
}
